﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YXQ.Common.CacheManager;
using YXQ.Common.Helper;
using YXQ.Dao.ViewModel;

namespace YXQ.Service
{
    public class BaseControl : System.Web.UI.UserControl
    {
       
        public int reqID { get; set; }
        public UserModel AdminUser { get; set; }
        protected override void OnInit(EventArgs e)
        {


            if (!string.IsNullOrEmpty(Request["ID"]))
            {
                try
                {

                    reqID = Convert.ToInt32(Request["ID"]);
                }
                catch (Exception)
                {
                    reqID = 0;
                    //  LogHelper.Error("获取的ID不为数字！" + Request["ID"]);
                }
            }

            if (MembershipService.GetUser() == null)
            {
                // Response.Redirect("~/Login.aspx");
                JsHelper.Redirect("../Login.aspx", "iframe");

                return;
            }
            AdminUser = MembershipService.GetUser();
            base.OnInit(e);
        }


    }
}

